package com.hqhsc.module.manage.activity.domain;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ActivityRowMapper implements RowMapper<Activity>{
	public Activity mapRow(ResultSet rs, int arg1) throws SQLException {
        Activity activity=new Activity();

        activity.setId(rs.getInt("id"));
        activity.setName(rs.getString("name"));

        activity.setTemplet_id(rs.getLong("templet_id"));
        activity.setType(rs.getInt("type"));
        activity.setTitle(rs.getString("title"));
        activity.setDescription(rs.getString("description"));
        activity.setContent(rs.getString("content"));
        activity.setFlow(rs.getString("flow"));
        activity.setPlace(rs.getString("place"));
        activity.setBegin_time(rs.getString("begin_time"));
        activity.setEnd_time(rs.getString("end_time"));
        activity.setStatus(rs.getInt("status"));
        activity.setCreate_at(rs.getString("create_at"));
        activity.setCreate_by(rs.getLong("create_by"));
        activity.setCover_url(rs.getString("cover_url"));
        try{
            activity.setCreate_by_name(rs.getString("user_name"));
        } catch (Exception e){}

        try{
            activity.setPv(rs.getLong("pv"));
        } catch (Exception e){}
        try{
            activity.setUv(rs.getLong("uv"));
        } catch (Exception e){}
        try{
            activity.setSignup_count(rs.getLong("signup_count"));
        } catch (Exception e){}
        try{
            activity.setPoint_count(rs.getLong("point_count"));
        } catch (Exception e){}

        try{
            activity.setSign_qr_code(rs.getString("sign_qr_code"));
        } catch (Exception e){}

		return activity;
	}
}
